package com.nhim.cms.domain;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name = "nhim_content_version_value", catalog = "nhim_cms")
public class ContentVersionValue implements java.io.Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private Integer id;
	private ContentVersion contentVersion;
	private ElementDefinition elementDefinition;
	private String value;
	private Integer version;
	
	public ContentVersionValue()
	{
		
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}
	/**
	 * @param contentVersion the contentVersion to set
	 */
	public void setContentVersion(ContentVersion contentVersion) {
		this.contentVersion = contentVersion;
	}
	/**
	 * @return the contentVersion
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "content_version_id", nullable = false)
	public ContentVersion getContentVersion() {
		return contentVersion;
	}
	/**
	 * @param elementDefinition the elementDefinition to set
	 */
	public void setElementDefinition(ElementDefinition elementDefinition) {
		this.elementDefinition = elementDefinition;
	}
	/**
	 * @return the elementDefinition
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "element_definition_id", nullable = false)
	public ElementDefinition getElementDefinition() {
		return elementDefinition;
	}
	/**
	 * @param value the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}
	/**
	 * @return the value
	 */
	@Lob 
	@Column(name = "value")
	public String getValue() {
		return value;
	}
	/**
	 * @param version the version to set
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}
	/**
	 * @return the version
	 */
	@Version
	@Column(name = "version")
	public Integer getVersion() {
		return version;
	}
}
